package com.hubeiweb.controller;

import com.hubeiweb.pojo.User;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        ModelAndView mav=new ModelAndView();
        User user =new User(1,"管理员","男");
        mav.addObject("user",user);
        mav.setViewName("/WEB-INF/jsp/index.jsp");
        return mav;
    }
}
